ci(dummies): validate packaged netstandard2.0 and net8.0 assets#195
Merged
Conversation
Dummies ships lib/netstandard2.0 and lib/net8.0 in one package, but Dummies.UnitTests targets net10.0 and so only ever exercises the net8.0 asset NuGet resolves as nearest-compatible. The netstandard2.0 asset is compiled but never executed by a test, so a downlevel-only regression (conditional compilation, API availability, seeded reproducibility) could reach NuGet with the suite green. Add a dedicated workflow that packs the real .nupkg and consumes it from an isolated project (tools/dummies-check) once per consumer TFM, mirroring the pack-and-consume pattern of tools/floor-check: * net8.0 consumer forces the net8.0 asset (modern generators present); * net6.0 consumer forces the netstandard2.0 asset (modern generators absent), the leg the net10.0 test project can never reach. The consumer proves by reflection which asset loaded, checks the conditional net8.0 surface (DateOnly/TimeOnly/Int128/UInt128/Half) is present only on the intended asset, exercises the common smoke surface (scalars, constraints, composition, collections, seeded reproducibility), and exits non-zero naming the asset that regressed. A net472 leg (netstandard2.0 on the .NET Framework CLR) is left as a documented follow-up: it would be the repository's first Framework target. Refs: #191
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dummiesshipslib/netstandard2.0andlib/net8.0in one package, butDummies.UnitTeststargetsnet10.0and only ever exercises thenet8.0asset NuGet resolves as nearest-compatible. This adds a dedicated workflow that packs the real.nupkgand consumes it once per consumer TFM, so thenetstandard2.0asset that actually ships is executed and validated.Type of change
Changes
.github/workflows/dummies.yml: packsDummiesunder the release SDK (.NET 10), then consumes the packed package from an isolated project once per consumer TFM —net8.0→net8.0asset,net6.0→netstandard2.0asset — on the real .NET 6 / .NET 8 runtimes.tools/dummies-check/(deliberately outsideFirstClassErrors.sln), mirroring the pack-and-consume pattern oftools/floor-check/: throwaway per-run version,nuget.configwith<clear/>+packageSourceMappingpinningDummiesto the local feed, project-localRestorePackagesPath. No nestedglobal.json: the contract under test is the TFM asset, not the SDK.Program.csproves by reflection which asset loaded, asserts the conditional net8.0 surface (DateOnly/TimeOnly/Int128/UInt128/Half) is present only on the intended asset, exercises the common smoke surface (scalars, constraints, composition, collections, seeded reproducibility), and exits non-zero naming the regressed asset (via anASSET=/RESULT=banner the workflow greps)..gitignore: ignore the check's generatedlocal-feed/,packages/,*.log.net472leg (netstandard2.0 on the .NET Framework CLR) is left as a documented follow-up — it would be the repository's first Framework target (Windows runner + Framework toolchain).Testing
Ran locally. This environment carries only the .NET 10 runtime, so both consumer legs were run with
DOTNET_ROLL_FORWARD=LatestMajoronto .NET 10; CI exercises the real .NET 6 / .NET 8 runtimes. Local runs therefore prove asset selection, reflection present/absence, the smoke surface and the red path — not runtime behaviour on 6/8, which CI adds.dotnet pack Dummies/Dummies.csproj→.nupkgcontains bothlib/netstandard2.0andlib/net8.0..NETCoreApp,Version=v8.0, modern generators present,RESULT=PASS..NETStandard,Version=v2.0, modern generators absent,RESULT=PASS.RESULT=FAILand a non-zero exit tagged with the asset — the red path works.The full solution build/test was not run: this change is additive and lives entirely outside
FirstClassErrors.sln.dotnet build FirstClassErrors.slndotnet test FirstClassErrors.slnFirstClassErrors.Analyzers.UnitTests)Documentation
Architecture decisions
Related issues
Closes #191
🤖 Generated with Claude Code
https://claude.ai/code/session_012NhzokwQfe9ZiL4Bc1dt7Y
Generated by Claude Code